From: Matthias Clasen Date: Thu, 6 Oct 2022 02:59:51 +0000 (-0400) Subject: gtk: Rename some private headers X-Git-Tag: archive/raspbian/4.12.3+ds-1+rpi1~1^2^2^2~116^2~1^2~199^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=7c5e1c61952a03d8bf45adb54e3121fd5473dcac;p=gtk4.git gtk: Rename some private headers Improve the consistency of our private header naming, by add 'private' to a bunch of them. --- diff --git a/gtk/a11y/gtkatspipango.c b/gtk/a11y/gtkatspipango.c index f0f3ed746f..2ca7bd419b 100644 --- a/gtk/a11y/gtkatspipango.c +++ b/gtk/a11y/gtkatspipango.c @@ -18,7 +18,7 @@ #include "config.h" #include "gtkatspipangoprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" void gtk_pango_get_font_attributes (PangoFontDescription *font, diff --git a/gtk/a11y/gtkatspitext.c b/gtk/a11y/gtkatspitext.c index 1e6c8c5ae7..efd588a8b2 100644 --- a/gtk/a11y/gtkatspitext.c +++ b/gtk/a11y/gtkatspitext.c @@ -35,7 +35,7 @@ #include "gtkentryprivate.h" #include "gtkinscriptionprivate.h" #include "gtklabelprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtkpasswordentryprivate.h" #include "gtksearchentryprivate.h" #include "gtkspinbuttonprivate.h" diff --git a/gtk/a11y/gtkatspitextbuffer.c b/gtk/a11y/gtkatspitextbuffer.c index bb8869db62..81afecab2c 100644 --- a/gtk/a11y/gtkatspitextbuffer.c +++ b/gtk/a11y/gtkatspitextbuffer.c @@ -21,7 +21,7 @@ #include "gtkatspipangoprivate.h" #include "gtktextbufferprivate.h" #include "gtktextviewprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" void gtk_text_view_add_default_attributes (GtkTextView *view, diff --git a/gtk/gskpango.c b/gtk/gskpango.c index e96c84a2fc..41a4b1a7bc 100644 --- a/gtk/gskpango.c +++ b/gtk/gskpango.c @@ -21,7 +21,7 @@ #include "gsk/gsk.h" #include "gsk/gskrendernodeprivate.h" -#include "gskpango.h" +#include "gskpangoprivate.h" #include "gtksnapshotprivate.h" #include "gtktextlayoutprivate.h" #include "gtktextviewprivate.h" diff --git a/gtk/gskpango.h b/gtk/gskpango.h deleted file mode 100644 index 672128d1c1..0000000000 --- a/gtk/gskpango.h +++ /dev/null @@ -1,88 +0,0 @@ -/* GSK - The GTK Scene Kit - * - * Copyright 2017 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#ifndef __GSK_PANGO_H__ -#define __GSK_PANGO_H__ - -#include -#include "gtk/gtksnapshot.h" - -G_BEGIN_DECLS - -#define GSK_TYPE_PANGO_RENDERER (gsk_pango_renderer_get_type ()) -#define GSK_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_PANGO_RENDERER, GskPangoRenderer)) -#define GSK_IS_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_PANGO_RENDERER)) -#define GSK_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_PANGO_RENDERER, GskPangoRendererClass)) -#define GSK_IS_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_PANGO_RENDERER)) -#define GSK_PANGO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_PANGO_RENDERER, GskPangoRendererClass)) - -typedef struct _GskPangoRenderer GskPangoRenderer; -typedef struct _GskPangoRendererClass GskPangoRendererClass; - -typedef enum -{ - GSK_PANGO_RENDERER_NORMAL, - GSK_PANGO_RENDERER_SELECTED, - GSK_PANGO_RENDERER_CURSOR -} GskPangoRendererState; - -typedef gboolean (*GskPangoShapeHandler) (PangoAttrShape *attr, - GdkSnapshot *snapshot, - double width, - double height); - -/* - * This is a PangoRenderer implementation that translates all the draw calls to - * gsk render nodes, using the GtkSnapshot helper class. Glyphs are translated - * to text nodes, other draw calls may fall back to cairo nodes. - */ - -struct _GskPangoRenderer -{ - PangoRenderer parent_instance; - - GtkWidget *widget; - GtkSnapshot *snapshot; - const GdkRGBA *fg_color; - - /* Error underline color for this widget */ - GdkRGBA *error_color; - - GskPangoRendererState state; - - guint is_cached_renderer : 1; - - GskPangoShapeHandler shape_handler; -}; - -struct _GskPangoRendererClass -{ - PangoRendererClass parent_class; -}; - -GType gsk_pango_renderer_get_type (void) G_GNUC_CONST; -void gsk_pango_renderer_set_state (GskPangoRenderer *crenderer, - GskPangoRendererState state); -void gsk_pango_renderer_set_shape_handler (GskPangoRenderer *crenderer, - GskPangoShapeHandler handler); -GskPangoRenderer *gsk_pango_renderer_acquire (void); -void gsk_pango_renderer_release (GskPangoRenderer *crenderer); - -G_END_DECLS - -#endif /* __GSK_PANGO_H__ */ diff --git a/gtk/gskpangoprivate.h b/gtk/gskpangoprivate.h new file mode 100644 index 0000000000..5641f9cd67 --- /dev/null +++ b/gtk/gskpangoprivate.h @@ -0,0 +1,88 @@ +/* GSK - The GTK Scene Kit + * + * Copyright 2017 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#ifndef __GSK_PANGO_PRIVATE_H__ +#define __GSK_PANGO_PRIVATE_H__ + +#include +#include "gtk/gtksnapshot.h" + +G_BEGIN_DECLS + +#define GSK_TYPE_PANGO_RENDERER (gsk_pango_renderer_get_type ()) +#define GSK_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSK_TYPE_PANGO_RENDERER, GskPangoRenderer)) +#define GSK_IS_PANGO_RENDERER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSK_TYPE_PANGO_RENDERER)) +#define GSK_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSK_TYPE_PANGO_RENDERER, GskPangoRendererClass)) +#define GSK_IS_PANGO_RENDERER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GSK_TYPE_PANGO_RENDERER)) +#define GSK_PANGO_RENDERER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSK_TYPE_PANGO_RENDERER, GskPangoRendererClass)) + +typedef struct _GskPangoRenderer GskPangoRenderer; +typedef struct _GskPangoRendererClass GskPangoRendererClass; + +typedef enum +{ + GSK_PANGO_RENDERER_NORMAL, + GSK_PANGO_RENDERER_SELECTED, + GSK_PANGO_RENDERER_CURSOR +} GskPangoRendererState; + +typedef gboolean (*GskPangoShapeHandler) (PangoAttrShape *attr, + GdkSnapshot *snapshot, + double width, + double height); + +/* + * This is a PangoRenderer implementation that translates all the draw calls to + * gsk render nodes, using the GtkSnapshot helper class. Glyphs are translated + * to text nodes, other draw calls may fall back to cairo nodes. + */ + +struct _GskPangoRenderer +{ + PangoRenderer parent_instance; + + GtkWidget *widget; + GtkSnapshot *snapshot; + const GdkRGBA *fg_color; + + /* Error underline color for this widget */ + GdkRGBA *error_color; + + GskPangoRendererState state; + + guint is_cached_renderer : 1; + + GskPangoShapeHandler shape_handler; +}; + +struct _GskPangoRendererClass +{ + PangoRendererClass parent_class; +}; + +GType gsk_pango_renderer_get_type (void) G_GNUC_CONST; +void gsk_pango_renderer_set_state (GskPangoRenderer *crenderer, + GskPangoRendererState state); +void gsk_pango_renderer_set_shape_handler (GskPangoRenderer *crenderer, + GskPangoShapeHandler handler); +GskPangoRenderer *gsk_pango_renderer_acquire (void); +void gsk_pango_renderer_release (GskPangoRenderer *crenderer); + +G_END_DECLS + +#endif /* __GSK_PANGO_PRIVATE_H__ */ diff --git a/gtk/gtkcssshadowvalue.c b/gtk/gtkcssshadowvalue.c index ba74f321ad..66029dbff4 100644 --- a/gtk/gtkcssshadowvalue.c +++ b/gtk/gtkcssshadowvalue.c @@ -25,7 +25,7 @@ #include "gtkcssnumbervalueprivate.h" #include "gtkcsscolorvalueprivate.h" #include "gtksnapshotprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gsk/gskcairoblurprivate.h" #include "gsk/gskroundedrectprivate.h" diff --git a/gtk/gtkdragicon.c b/gtk/gtkdragicon.c index f82dbb6aeb..8918caf5eb 100644 --- a/gtk/gtkdragicon.c +++ b/gtk/gtkdragicon.c @@ -34,7 +34,7 @@ #include "gtkimage.h" #include "gtklabel.h" #include "gtkrendernodepaintableprivate.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" /** diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 3c2febf3c0..e66812ba18 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -48,7 +48,7 @@ #include "gtklabel.h" #include "gtkmain.h" #include "gtkmarshalers.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtkpopover.h" #include "gtkprivate.h" #include "gtkprogressbar.h" @@ -56,7 +56,7 @@ #include "gtksnapshot.h" #include "gtktextprivate.h" #include "gtktexthandleprivate.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" #include "gtktooltip.h" #include "gtktypebuiltins.h" #include "gtkwidgetprivate.h" diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index e2bf702c04..c86a08a4bf 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -45,7 +45,7 @@ #include "gtkmessagedialog.h" #include "gtkmountoperation.h" #include "gtkpaned.h" -#include "gtkpathbar.h" +#include "gtkpathbarprivate.h" #include "gtkplacessidebarprivate.h" #include "gtkplacesviewprivate.h" #include "gtkprivate.h" diff --git a/gtk/gtkfilesystemmodel.c b/gtk/gtkfilesystemmodel.c index 10fe1ec5e5..46d7f10b91 100644 --- a/gtk/gtkfilesystemmodel.c +++ b/gtk/gtkfilesystemmodel.c @@ -25,7 +25,7 @@ #include "gtkfilechooserutils.h" #include "gtkmarshalers.h" -#include "gtktreedatalist.h" +#include "gtktreedatalistprivate.h" #include "gtktreednd.h" #include "gtktreemodel.h" #include "gtkfilter.h" diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c index 42dff1eada..598c6600c0 100644 --- a/gtk/gtkinscription.c +++ b/gtk/gtkinscription.c @@ -23,7 +23,7 @@ #include "gtkcssnodeprivate.h" #include "gtkcssstylechangeprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtksnapshot.h" #include "gtktypebuiltins.h" #include "gtkwidgetprivate.h" diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c index 7602401d3c..9e2ce06cd6 100644 --- a/gtk/gtklabel.c +++ b/gtk/gtklabel.c @@ -35,7 +35,7 @@ #include #include "gtkmarshalers.h" #include "gtknotebook.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtkprivate.h" #include "gtkshortcut.h" #include "gtkshortcutcontroller.h" @@ -43,7 +43,7 @@ #include "gtkshow.h" #include "gtksnapshot.h" #include "gtkstylecontextprivate.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" #include "gtktooltip.h" #include "gtktypebuiltins.h" #include "gtkwidgetprivate.h" diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index acf7b8942f..4e442bed31 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -22,7 +22,7 @@ #include #include "gtktreemodel.h" #include "gtkliststore.h" -#include "gtktreedatalist.h" +#include "gtktreedatalistprivate.h" #include "gtktreednd.h" #include "gtkbuildable.h" #include "gtkbuilderprivate.h" diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c index 3ba6c23aba..68a80e5c46 100644 --- a/gtk/gtkpango.c +++ b/gtk/gtkpango.c @@ -23,7 +23,7 @@ */ #include "config.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include #include "gtkbuilderprivate.h" diff --git a/gtk/gtkpango.h b/gtk/gtkpango.h deleted file mode 100644 index 3d673d9b0a..0000000000 --- a/gtk/gtkpango.h +++ /dev/null @@ -1,66 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_PANGO_H__ -#define __GTK_PANGO_H__ - -#include -#include "gtkbuildable.h" - -G_BEGIN_DECLS - -PangoAttrList *_gtk_pango_attr_list_merge (PangoAttrList *into, - PangoAttrList *from) G_GNUC_WARN_UNUSED_RESULT; - -gboolean gtk_buildable_attribute_tag_start (GtkBuildable *buildable, - GtkBuilder *builder, - GObject *child, - const char *tagname, - GtkBuildableParser *parser, - gpointer *data); - -typedef struct { - GtkBuilder *builder; - GObject *object; - PangoAttrList *attrs; -} GtkPangoAttributeParserData; - -void -gtk_pango_attribute_start_element (GtkBuildableParseContext *context, - const char *element_name, - const char **names, - const char **values, - gpointer user_data, - GError **error); - -const char *pango_wrap_mode_to_string (PangoWrapMode mode); -const char *pango_underline_to_string (PangoUnderline underline); -const char *pango_stretch_to_string (PangoStretch stretch); -const char *pango_style_to_string (PangoStyle style); -const char *pango_variant_to_string (PangoVariant variant); -const char *pango_align_to_string (PangoAlignment align); - -G_END_DECLS - -#endif /* __GTK_PANGO_H__ */ diff --git a/gtk/gtkpangoprivate.h b/gtk/gtkpangoprivate.h new file mode 100644 index 0000000000..cb16bcb331 --- /dev/null +++ b/gtk/gtkpangoprivate.h @@ -0,0 +1,66 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_PANGO_PRIVATE_H__ +#define __GTK_PANGO_PRIVATE_H__ + +#include +#include "gtkbuildable.h" + +G_BEGIN_DECLS + +PangoAttrList *_gtk_pango_attr_list_merge (PangoAttrList *into, + PangoAttrList *from) G_GNUC_WARN_UNUSED_RESULT; + +gboolean gtk_buildable_attribute_tag_start (GtkBuildable *buildable, + GtkBuilder *builder, + GObject *child, + const char *tagname, + GtkBuildableParser *parser, + gpointer *data); + +typedef struct { + GtkBuilder *builder; + GObject *object; + PangoAttrList *attrs; +} GtkPangoAttributeParserData; + +void +gtk_pango_attribute_start_element (GtkBuildableParseContext *context, + const char *element_name, + const char **names, + const char **values, + gpointer user_data, + GError **error); + +const char *pango_wrap_mode_to_string (PangoWrapMode mode); +const char *pango_underline_to_string (PangoUnderline underline); +const char *pango_stretch_to_string (PangoStretch stretch); +const char *pango_style_to_string (PangoStyle style); +const char *pango_variant_to_string (PangoVariant variant); +const char *pango_align_to_string (PangoAlignment align); + +G_END_DECLS + +#endif /* __GTK_PANGO_PRIVATE_H__ */ diff --git a/gtk/gtkpathbar.c b/gtk/gtkpathbar.c index 9e4916d562..62aa838d2a 100644 --- a/gtk/gtkpathbar.c +++ b/gtk/gtkpathbar.c @@ -18,7 +18,7 @@ #include "config.h" -#include "gtkpathbar.h" +#include "gtkpathbarprivate.h" #include diff --git a/gtk/gtkpathbar.h b/gtk/gtkpathbar.h deleted file mode 100644 index 11ed72455d..0000000000 --- a/gtk/gtkpathbar.h +++ /dev/null @@ -1,41 +0,0 @@ -/* gtkpathbar.h - * Copyright (C) 2004 Red Hat, Inc., Jonathan Blandford - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library. If not, see . - */ - -#ifndef __GTK_PATH_BAR_H__ -#define __GTK_PATH_BAR_H__ - -#include "gtkwidget.h" - -G_BEGIN_DECLS - -#define GTK_TYPE_PATH_BAR (gtk_path_bar_get_type ()) -#define GTK_PATH_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PATH_BAR, GtkPathBar)) -#define GTK_IS_PATH_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PATH_BAR)) - -typedef struct _GtkPathBar GtkPathBar; - -GDK_AVAILABLE_IN_ALL -GType gtk_path_bar_get_type (void) G_GNUC_CONST; -void _gtk_path_bar_set_file (GtkPathBar *path_bar, - GFile *file, - gboolean keep_trail); -void _gtk_path_bar_up (GtkPathBar *path_bar); -void _gtk_path_bar_down (GtkPathBar *path_bar); - -G_END_DECLS - -#endif /* __GTK_PATH_BAR_H__ */ diff --git a/gtk/gtkpathbarprivate.h b/gtk/gtkpathbarprivate.h new file mode 100644 index 0000000000..3b20985929 --- /dev/null +++ b/gtk/gtkpathbarprivate.h @@ -0,0 +1,41 @@ +/* gtkpathbarprivate.h + * Copyright (C) 2004 Red Hat, Inc., Jonathan Blandford + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#ifndef __GTK_PATH_BAR_PRIVATE_H__ +#define __GTK_PATH_BAR_PRIVATE_H__ + +#include "gtkwidget.h" + +G_BEGIN_DECLS + +#define GTK_TYPE_PATH_BAR (gtk_path_bar_get_type ()) +#define GTK_PATH_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PATH_BAR, GtkPathBar)) +#define GTK_IS_PATH_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PATH_BAR)) + +typedef struct _GtkPathBar GtkPathBar; + +GDK_AVAILABLE_IN_ALL +GType gtk_path_bar_get_type (void) G_GNUC_CONST; +void _gtk_path_bar_set_file (GtkPathBar *path_bar, + GFile *file, + gboolean keep_trail); +void _gtk_path_bar_up (GtkPathBar *path_bar); +void _gtk_path_bar_down (GtkPathBar *path_bar); + +G_END_DECLS + +#endif /* __GTK_PATH_BAR_PRIVATE_H__ */ diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c index 0e6120c7b8..b2fb2aaeb8 100644 --- a/gtk/gtkplacessidebar.c +++ b/gtk/gtkplacessidebar.c @@ -41,7 +41,7 @@ #include "gtkmountoperation.h" #include "gtkscrolledwindow.h" #include "gtksettings.h" -#include "gtktrashmonitor.h" +#include "gtktrashmonitorprivate.h" #include "gtktypebuiltins.h" #include "gtkprivatetypebuiltins.h" #include "gtkpopovermenu.h" diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c index afa27b45f1..f3902fa376 100644 --- a/gtk/gtksnapshot.c +++ b/gtk/gtksnapshot.c @@ -35,7 +35,7 @@ #include "gsk/gskrendernodeprivate.h" #include "gsk/gskroundedrectprivate.h" -#include "gtk/gskpango.h" +#include "gtk/gskpangoprivate.h" #define GDK_ARRAY_NAME gtk_snapshot_nodes #define GDK_ARRAY_TYPE_NAME GtkSnapshotNodes diff --git a/gtk/gtktext.c b/gtk/gtktext.c index ba3e22387f..b7c40370b0 100644 --- a/gtk/gtktext.c +++ b/gtk/gtktext.c @@ -49,7 +49,7 @@ #include "gtkmagnifierprivate.h" #include "gtkmain.h" #include "gtkmarshalers.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtkpopovermenu.h" #include "gtkprivate.h" #include "gtksettings.h" @@ -57,7 +57,7 @@ #include "gtkstylecontextprivate.h" #include "gtktexthandleprivate.h" #include "gtktexthistoryprivate.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" #include "gtktooltip.h" #include "gtktypebuiltins.h" #include "gtkwidgetprivate.h" diff --git a/gtk/gtktextattributes.c b/gtk/gtktextattributes.c index 856b4f3310..d8cef2518e 100644 --- a/gtk/gtktextattributes.c +++ b/gtk/gtktextattributes.c @@ -49,7 +49,7 @@ #include "config.h" -#include "gtktextattributes.h" +#include "gtktextattributesprivate.h" #include "gtktexttagprivate.h" /** diff --git a/gtk/gtktextattributes.h b/gtk/gtktextattributes.h deleted file mode 100644 index 3aa01c8690..0000000000 --- a/gtk/gtktextattributes.h +++ /dev/null @@ -1,176 +0,0 @@ -/* gtktextattributes.h - text attributes - * - * Copyright (c) 1992-1994 The Regents of the University of California. - * Copyright (c) 1994-1997 Sun Microsystems, Inc. - * Copyright (c) 2000 Red Hat, Inc. - * Tk -> Gtk port by Havoc Pennington - * - * This software is copyrighted by the Regents of the University of - * California, Sun Microsystems, Inc., and other parties. The - * following terms apply to all files associated with the software - * unless explicitly disclaimed in individual files. - * - * The authors hereby grant permission to use, copy, modify, - * distribute, and license this software and its documentation for any - * purpose, provided that existing copyright notices are retained in - * all copies and that this notice is included verbatim in any - * distributions. No written agreement, license, or royalty fee is - * required for any of the authorized uses. Modifications to this - * software may be copyrighted by their authors and need not follow - * the licensing terms described here, provided that the new terms are - * clearly indicated on the first page of each file where they apply. - * - * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY - * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL - * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, - * OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED - * OF THE POSSIBILITY OF SUCH DAMAGE. - * - * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, - * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND - * NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, - * AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE - * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. - * - * GOVERNMENT USE: If you are acquiring this software on behalf of the - * U.S. government, the Government shall have only "Restricted Rights" - * in the software and related documentation as defined in the Federal - * Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you - * are acquiring the software on behalf of the Department of Defense, - * the software shall be classified as "Commercial Computer Software" - * and the Government shall have only "Restricted Rights" as defined - * in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the - * foregoing, the authors grant the U.S. Government and others acting - * in its behalf permission to use and distribute the software in - * accordance with the terms specified in this license. - * - */ - -#ifndef __GTK_TEXT_ATTRIBUTES_H__ -#define __GTK_TEXT_ATTRIBUTES_H__ - - -#include -#include - - -G_BEGIN_DECLS - -typedef struct _GtkTextAttributes GtkTextAttributes; -typedef struct _GtkTextAppearance GtkTextAppearance; - -struct _GtkTextAppearance -{ - GdkRGBA *bg_rgba; - GdkRGBA *fg_rgba; - GdkRGBA *underline_rgba; - GdkRGBA *overline_rgba; - GdkRGBA *strikethrough_rgba; - - /* super/subscript rise, can be negative */ - int rise; - - guint underline : 4; /* PangoUnderline */ - guint overline : 2; /* PangoOverline */ - guint strikethrough : 1; - - /* Whether to use background-related values; this is irrelevant for - * the values struct when in a tag, but is used for the composite - * values struct; it's true if any of the tags being composited - * had background stuff set. - */ - guint draw_bg : 1; - - /* These are only used when we are actually laying out and rendering - * a paragraph; not when a GtkTextAppearance is part of a - * GtkTextAttributes. - */ - guint inside_selection : 1; - guint is_text : 1; -}; - -/** - * GtkTextAttributes: - * @appearance: GtkTextAppearance for text. - * @justification: GtkJustification for text. - * @direction: GtkTextDirection for text. - * @font: `PangoFontDescription` for text. - * @font_scale: Font scale factor. - * @left_margin: Width of the left margin in pixels. - * @right_margin: Width of the right margin in pixels. - * @indent: Amount to indent the paragraph, in pixels. - * @pixels_above_lines: Pixels of blank space above paragraphs. - * @pixels_below_lines: Pixels of blank space below paragraphs. - * @pixels_inside_wrap: Pixels of blank space between wrapped lines in - * a paragraph. - * @tabs: Custom `PangoTabArray` for this text. - * @wrap_mode: `GtkWrapMode` for text. - * @language: `PangoLanguage` for text. - * @invisible: Hide the text. - * @bg_full_height: Background is fit to full line height rather than - * baseline +/- ascent/descent (font height). - * @editable: Can edit this text. - * @no_fallback: Whether to disable font fallback. - * @letter_spacing: Extra space to insert between graphemes, in Pango units - * - * Using GtkTextAttributes directly should rarely be necessary. - * It’s primarily useful with gtk_text_iter_get_attributes(). - * As with most GTK structs, the fields in this struct should only - * be read, never modified directly. - */ -struct _GtkTextAttributes -{ - guint refcount; - - GtkJustification justification; - GtkTextDirection direction; - GtkWrapMode wrap_mode; - - GtkTextAppearance appearance; - - PangoFontDescription *font; - char *font_features; - - GdkRGBA *pg_bg_rgba; - - PangoTabArray *tabs; - PangoLanguage *language; - - double font_scale; - - int left_margin; - int right_margin; - int indent; - - int pixels_above_lines; - int pixels_below_lines; - int pixels_inside_wrap; - - float line_height; - - int letter_spacing; - - guint invisible : 1; - guint bg_full_height : 1; - guint editable : 1; - guint no_fallback: 1; - guint no_breaks : 1; - guint show_spaces : 3; /* PangoShowFlags */ - guint no_hyphens : 1; - guint line_height_is_absolute : 1; - guint text_transform : 3; /* PangoTextTransform */ - guint word : 1; - guint sentence : 1; -}; - -GtkTextAttributes* gtk_text_attributes_new (void); -GtkTextAttributes* gtk_text_attributes_copy (GtkTextAttributes *src); -void gtk_text_attributes_copy_values (GtkTextAttributes *src, - GtkTextAttributes *dest); -void gtk_text_attributes_unref (GtkTextAttributes *values); -GtkTextAttributes *gtk_text_attributes_ref (GtkTextAttributes *values); - -G_END_DECLS - -#endif diff --git a/gtk/gtktextattributesprivate.h b/gtk/gtktextattributesprivate.h new file mode 100644 index 0000000000..71b4ad6b35 --- /dev/null +++ b/gtk/gtktextattributesprivate.h @@ -0,0 +1,176 @@ +/* gtktextattributes.h - text attributes + * + * Copyright (c) 1992-1994 The Regents of the University of California. + * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 2000 Red Hat, Inc. + * Tk -> Gtk port by Havoc Pennington + * + * This software is copyrighted by the Regents of the University of + * California, Sun Microsystems, Inc., and other parties. The + * following terms apply to all files associated with the software + * unless explicitly disclaimed in individual files. + * + * The authors hereby grant permission to use, copy, modify, + * distribute, and license this software and its documentation for any + * purpose, provided that existing copyright notices are retained in + * all copies and that this notice is included verbatim in any + * distributions. No written agreement, license, or royalty fee is + * required for any of the authorized uses. Modifications to this + * software may be copyrighted by their authors and need not follow + * the licensing terms described here, provided that the new terms are + * clearly indicated on the first page of each file where they apply. + * + * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY + * PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL + * DAMAGES ARISING OUT OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, + * OR ANY DERIVATIVES THEREOF, EVEN IF THE AUTHORS HAVE BEEN ADVISED + * OF THE POSSIBILITY OF SUCH DAMAGE. + * + * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND + * NON-INFRINGEMENT. THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, + * AND THE AUTHORS AND DISTRIBUTORS HAVE NO OBLIGATION TO PROVIDE + * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * GOVERNMENT USE: If you are acquiring this software on behalf of the + * U.S. government, the Government shall have only "Restricted Rights" + * in the software and related documentation as defined in the Federal + * Acquisition Regulations (FARs) in Clause 52.227.19 (c) (2). If you + * are acquiring the software on behalf of the Department of Defense, + * the software shall be classified as "Commercial Computer Software" + * and the Government shall have only "Restricted Rights" as defined + * in Clause 252.227-7013 (c) (1) of DFARs. Notwithstanding the + * foregoing, the authors grant the U.S. Government and others acting + * in its behalf permission to use and distribute the software in + * accordance with the terms specified in this license. + * + */ + +#ifndef __GTK_TEXT_ATTRIBUTES_PRIVATE_H__ +#define __GTK_TEXT_ATTRIBUTES_PRIVATE_H__ + + +#include +#include + + +G_BEGIN_DECLS + +typedef struct _GtkTextAttributes GtkTextAttributes; +typedef struct _GtkTextAppearance GtkTextAppearance; + +struct _GtkTextAppearance +{ + GdkRGBA *bg_rgba; + GdkRGBA *fg_rgba; + GdkRGBA *underline_rgba; + GdkRGBA *overline_rgba; + GdkRGBA *strikethrough_rgba; + + /* super/subscript rise, can be negative */ + int rise; + + guint underline : 4; /* PangoUnderline */ + guint overline : 2; /* PangoOverline */ + guint strikethrough : 1; + + /* Whether to use background-related values; this is irrelevant for + * the values struct when in a tag, but is used for the composite + * values struct; it's true if any of the tags being composited + * had background stuff set. + */ + guint draw_bg : 1; + + /* These are only used when we are actually laying out and rendering + * a paragraph; not when a GtkTextAppearance is part of a + * GtkTextAttributes. + */ + guint inside_selection : 1; + guint is_text : 1; +}; + +/** + * GtkTextAttributes: + * @appearance: GtkTextAppearance for text. + * @justification: GtkJustification for text. + * @direction: GtkTextDirection for text. + * @font: `PangoFontDescription` for text. + * @font_scale: Font scale factor. + * @left_margin: Width of the left margin in pixels. + * @right_margin: Width of the right margin in pixels. + * @indent: Amount to indent the paragraph, in pixels. + * @pixels_above_lines: Pixels of blank space above paragraphs. + * @pixels_below_lines: Pixels of blank space below paragraphs. + * @pixels_inside_wrap: Pixels of blank space between wrapped lines in + * a paragraph. + * @tabs: Custom `PangoTabArray` for this text. + * @wrap_mode: `GtkWrapMode` for text. + * @language: `PangoLanguage` for text. + * @invisible: Hide the text. + * @bg_full_height: Background is fit to full line height rather than + * baseline +/- ascent/descent (font height). + * @editable: Can edit this text. + * @no_fallback: Whether to disable font fallback. + * @letter_spacing: Extra space to insert between graphemes, in Pango units + * + * Using GtkTextAttributes directly should rarely be necessary. + * It’s primarily useful with gtk_text_iter_get_attributes(). + * As with most GTK structs, the fields in this struct should only + * be read, never modified directly. + */ +struct _GtkTextAttributes +{ + guint refcount; + + GtkJustification justification; + GtkTextDirection direction; + GtkWrapMode wrap_mode; + + GtkTextAppearance appearance; + + PangoFontDescription *font; + char *font_features; + + GdkRGBA *pg_bg_rgba; + + PangoTabArray *tabs; + PangoLanguage *language; + + double font_scale; + + int left_margin; + int right_margin; + int indent; + + int pixels_above_lines; + int pixels_below_lines; + int pixels_inside_wrap; + + float line_height; + + int letter_spacing; + + guint invisible : 1; + guint bg_full_height : 1; + guint editable : 1; + guint no_fallback: 1; + guint no_breaks : 1; + guint show_spaces : 3; /* PangoShowFlags */ + guint no_hyphens : 1; + guint line_height_is_absolute : 1; + guint text_transform : 3; /* PangoTextTransform */ + guint word : 1; + guint sentence : 1; +}; + +GtkTextAttributes* gtk_text_attributes_new (void); +GtkTextAttributes* gtk_text_attributes_copy (GtkTextAttributes *src); +void gtk_text_attributes_copy_values (GtkTextAttributes *src, + GtkTextAttributes *dest); +void gtk_text_attributes_unref (GtkTextAttributes *values); +GtkTextAttributes *gtk_text_attributes_ref (GtkTextAttributes *values); + +G_END_DECLS + +#endif diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c index cdf100e4fe..2a756e49d4 100644 --- a/gtk/gtktextbtree.c +++ b/gtk/gtktextbtree.c @@ -53,7 +53,7 @@ */ #include "config.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include #include #include @@ -65,8 +65,8 @@ #include "gtktextiterprivate.h" #include "gtkdebug.h" #include "gtktextmarkprivate.h" -#include "gtktextsegment.h" -#include "gtkpango.h" +#include "gtktextsegmentprivate.h" +#include "gtkpangoprivate.h" #include "gdkprivate.h" /* diff --git a/gtk/gtktextbtree.h b/gtk/gtktextbtree.h deleted file mode 100644 index 66e61c686f..0000000000 --- a/gtk/gtktextbtree.h +++ /dev/null @@ -1,350 +0,0 @@ -/* GTK - The GIMP Toolkit - * gtktextbtree.h Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_TEXT_BTREE_H__ -#define __GTK_TEXT_BTREE_H__ - -#if 0 -#define DEBUG_VALIDATION_AND_SCROLLING -#endif - -#ifdef DEBUG_VALIDATION_AND_SCROLLING -#define DV(x) (x) -#else -#define DV(x) -#endif - -#include -#include -#include -#include -#include -#include - -G_BEGIN_DECLS - -GtkTextBTree *_gtk_text_btree_new (GtkTextTagTable *table, - GtkTextBuffer *buffer); -void _gtk_text_btree_ref (GtkTextBTree *tree); -void _gtk_text_btree_unref (GtkTextBTree *tree); -GtkTextBuffer *_gtk_text_btree_get_buffer (GtkTextBTree *tree); - - -guint _gtk_text_btree_get_chars_changed_stamp (GtkTextBTree *tree); -guint _gtk_text_btree_get_segments_changed_stamp (GtkTextBTree *tree); -void _gtk_text_btree_segments_changed (GtkTextBTree *tree); - -gboolean _gtk_text_btree_is_end (GtkTextBTree *tree, - GtkTextLine *line, - GtkTextLineSegment *seg, - int byte_index, - int char_offset); - -/* Indexable segment mutation */ - -void _gtk_text_btree_delete (GtkTextIter *start, - GtkTextIter *end); -void _gtk_text_btree_insert (GtkTextIter *iter, - const char *text, - int len); -void _gtk_text_btree_insert_paintable (GtkTextIter *iter, - GdkPaintable *texture); - -void _gtk_text_btree_insert_child_anchor (GtkTextIter *iter, - GtkTextChildAnchor *anchor); - -void _gtk_text_btree_unregister_child_anchor (GtkTextChildAnchor *anchor); - -/* View stuff */ -GtkTextLine *_gtk_text_btree_find_line_by_y (GtkTextBTree *tree, - gpointer view_id, - int ypixel, - int *line_top_y); -int _gtk_text_btree_find_line_top (GtkTextBTree *tree, - GtkTextLine *line, - gpointer view_id); -void _gtk_text_btree_add_view (GtkTextBTree *tree, - GtkTextLayout *layout); -void _gtk_text_btree_remove_view (GtkTextBTree *tree, - gpointer view_id); -void _gtk_text_btree_invalidate_region (GtkTextBTree *tree, - const GtkTextIter *start, - const GtkTextIter *end, - gboolean cursors_only); -void _gtk_text_btree_get_view_size (GtkTextBTree *tree, - gpointer view_id, - int *width, - int *height); -gboolean _gtk_text_btree_is_valid (GtkTextBTree *tree, - gpointer view_id); -gboolean _gtk_text_btree_validate (GtkTextBTree *tree, - gpointer view_id, - int max_pixels, - int *y, - int *old_height, - int *new_height); -void _gtk_text_btree_validate_line (GtkTextBTree *tree, - GtkTextLine *line, - gpointer view_id); - -/* Tag */ - -void _gtk_text_btree_tag (const GtkTextIter *start, - const GtkTextIter *end, - GtkTextTag *tag, - gboolean apply); - -/* "Getters" */ - -GtkTextLine * _gtk_text_btree_get_line (GtkTextBTree *tree, - int line_number, - int *real_line_number); -GtkTextLine * _gtk_text_btree_get_line_no_last (GtkTextBTree *tree, - int line_number, - int *real_line_number); -GtkTextLine * _gtk_text_btree_get_end_iter_line (GtkTextBTree *tree); -GtkTextLine * _gtk_text_btree_get_line_at_char (GtkTextBTree *tree, - int char_index, - int *line_start_index, - int *real_char_index); -GPtrArray * _gtk_text_btree_get_tags (const GtkTextIter *iter); -char *_gtk_text_btree_get_text (const GtkTextIter *start, - const GtkTextIter *end, - gboolean include_hidden, - gboolean include_nonchars); -int _gtk_text_btree_line_count (GtkTextBTree *tree); -int _gtk_text_btree_char_count (GtkTextBTree *tree); -gboolean _gtk_text_btree_char_is_invisible (const GtkTextIter *iter); - - - -/* Get iterators (these are implemented in gtktextiter.c) */ -void _gtk_text_btree_get_iter_at_char (GtkTextBTree *tree, - GtkTextIter *iter, - int char_index); -void _gtk_text_btree_get_iter_at_line_char (GtkTextBTree *tree, - GtkTextIter *iter, - int line_number, - int char_index); -void _gtk_text_btree_get_iter_at_line_byte (GtkTextBTree *tree, - GtkTextIter *iter, - int line_number, - int byte_index); -gboolean _gtk_text_btree_get_iter_from_string (GtkTextBTree *tree, - GtkTextIter *iter, - const char *string); -gboolean _gtk_text_btree_get_iter_at_mark_name (GtkTextBTree *tree, - GtkTextIter *iter, - const char *mark_name); -void _gtk_text_btree_get_iter_at_mark (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextMark *mark); -void _gtk_text_btree_get_iter_at_paintable (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextLineSegment *seg); -void _gtk_text_btree_get_end_iter (GtkTextBTree *tree, - GtkTextIter *iter); -void _gtk_text_btree_get_iter_at_line (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextLine *line, - int byte_offset); -gboolean _gtk_text_btree_get_iter_at_first_toggle (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextTag *tag); -gboolean _gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextTag *tag); - -void _gtk_text_btree_get_iter_at_child_anchor (GtkTextBTree *tree, - GtkTextIter *iter, - GtkTextChildAnchor *anchor); - - - -/* Manipulate marks */ -GtkTextMark *_gtk_text_btree_set_mark (GtkTextBTree *tree, - GtkTextMark *existing_mark, - const char *name, - gboolean left_gravity, - const GtkTextIter *index, - gboolean should_exist); -void _gtk_text_btree_remove_mark_by_name (GtkTextBTree *tree, - const char *name); -void _gtk_text_btree_remove_mark (GtkTextBTree *tree, - GtkTextMark *segment); -gboolean _gtk_text_btree_get_selection_bounds (GtkTextBTree *tree, - GtkTextIter *start, - GtkTextIter *end); -void _gtk_text_btree_place_cursor (GtkTextBTree *tree, - const GtkTextIter *where); -void _gtk_text_btree_select_range (GtkTextBTree *tree, - const GtkTextIter *ins, - const GtkTextIter *bound); -gboolean _gtk_text_btree_mark_is_insert (GtkTextBTree *tree, - GtkTextMark *segment); -gboolean _gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree, - GtkTextMark *segment); -GtkTextMark *_gtk_text_btree_get_insert (GtkTextBTree *tree); -GtkTextMark *_gtk_text_btree_get_selection_bound (GtkTextBTree *tree); -GtkTextMark *_gtk_text_btree_get_mark_by_name (GtkTextBTree *tree, - const char *name); -GtkTextLine * _gtk_text_btree_first_could_contain_tag (GtkTextBTree *tree, - GtkTextTag *tag); -GtkTextLine * _gtk_text_btree_last_could_contain_tag (GtkTextBTree *tree, - GtkTextTag *tag); - -/* Lines */ - -/* Chunk of data associated with a line; views can use this to store - info at the line. They should "subclass" the header struct here. */ -struct _GtkTextLineData { - gpointer view_id; - GtkTextLineData *next; - int height; - int top_ink : 16; - int bottom_ink : 16; - signed int width : 24; - guint valid : 8; /* Actually a boolean */ -}; - -/* - * The data structure below defines a single line of text (from newline - * to newline, not necessarily what appears on one line of the screen). - * - * You can consider this line a "paragraph" also - */ - -struct _GtkTextLine { - GtkTextBTreeNode *parent; /* Pointer to parent node containing - * line. */ - GtkTextLine *next; /* Next in linked list of lines with - * same parent node in B-tree. NULL - * means end of list. */ - GtkTextLineSegment *segments; /* First in ordered list of segments - * that make up the line. */ - GtkTextLineData *views; /* data stored here by views */ - guchar dir_strong; /* BiDi algo dir of line */ - guchar dir_propagated_back; /* BiDi algo dir of next line */ - guchar dir_propagated_forward; /* BiDi algo dir of prev line */ -}; - - -int _gtk_text_line_get_number (GtkTextLine *line); -gboolean _gtk_text_line_char_has_tag (GtkTextLine *line, - GtkTextBTree *tree, - int char_in_line, - GtkTextTag *tag); -gboolean _gtk_text_line_byte_has_tag (GtkTextLine *line, - GtkTextBTree *tree, - int byte_in_line, - GtkTextTag *tag); -gboolean _gtk_text_line_is_last (GtkTextLine *line, - GtkTextBTree *tree); -gboolean _gtk_text_line_contains_end_iter (GtkTextLine *line, - GtkTextBTree *tree); -GtkTextLine * _gtk_text_line_next (GtkTextLine *line); -GtkTextLine * _gtk_text_line_next_excluding_last (GtkTextLine *line); -GtkTextLine * _gtk_text_line_previous (GtkTextLine *line); -void _gtk_text_line_add_data (GtkTextLine *line, - GtkTextLineData *data); -gpointer _gtk_text_line_remove_data (GtkTextLine *line, - gpointer view_id); -gpointer _gtk_text_line_get_data (GtkTextLine *line, - gpointer view_id); -void _gtk_text_line_invalidate_wrap (GtkTextLine *line, - GtkTextLineData *ld); -int _gtk_text_line_char_count (GtkTextLine *line); -int _gtk_text_line_byte_count (GtkTextLine *line); -int _gtk_text_line_char_index (GtkTextLine *line); -GtkTextLineSegment *_gtk_text_line_byte_to_segment (GtkTextLine *line, - int byte_offset, - int *seg_offset); -GtkTextLineSegment *_gtk_text_line_char_to_segment (GtkTextLine *line, - int char_offset, - int *seg_offset); -gboolean _gtk_text_line_byte_locate (GtkTextLine *line, - int byte_offset, - GtkTextLineSegment **segment, - GtkTextLineSegment **any_segment, - int *seg_byte_offset, - int *line_byte_offset); -gboolean _gtk_text_line_char_locate (GtkTextLine *line, - int char_offset, - GtkTextLineSegment **segment, - GtkTextLineSegment **any_segment, - int *seg_char_offset, - int *line_char_offset); -void _gtk_text_line_byte_to_char_offsets (GtkTextLine *line, - int byte_offset, - int *line_char_offset, - int *seg_char_offset); -void _gtk_text_line_char_to_byte_offsets (GtkTextLine *line, - int char_offset, - int *line_byte_offset, - int *seg_byte_offset); -GtkTextLineSegment *_gtk_text_line_byte_to_any_segment (GtkTextLine *line, - int byte_offset, - int *seg_offset); -GtkTextLineSegment *_gtk_text_line_char_to_any_segment (GtkTextLine *line, - int char_offset, - int *seg_offset); -int _gtk_text_line_byte_to_char (GtkTextLine *line, - int byte_offset); -int _gtk_text_line_char_to_byte (GtkTextLine *line, - int char_offset); -GtkTextLine * _gtk_text_line_next_could_contain_tag (GtkTextLine *line, - GtkTextBTree *tree, - GtkTextTag *tag); -GtkTextLine * _gtk_text_line_previous_could_contain_tag (GtkTextLine *line, - GtkTextBTree *tree, - GtkTextTag *tag); - -GtkTextLineData *_gtk_text_line_data_new (GtkTextLayout *layout, - GtkTextLine *line); - -/* Debug */ -void _gtk_text_btree_check (GtkTextBTree *tree); -void _gtk_text_btree_spew (GtkTextBTree *tree); -extern gboolean _gtk_text_view_debug_btree; - -/* ignore, exported only for gtktextsegment.c */ -void _gtk_toggle_segment_check_func (GtkTextLineSegment *segPtr, - GtkTextLine *line); -void _gtk_change_node_toggle_count (GtkTextBTreeNode *node, - GtkTextTagInfo *info, - int delta); - -/* for gtktextmark.c */ -void _gtk_text_btree_release_mark_segment (GtkTextBTree *tree, - GtkTextLineSegment *segment); - -/* for coordination with the tag table */ -void _gtk_text_btree_notify_will_remove_tag (GtkTextBTree *tree, - GtkTextTag *tag); - -G_END_DECLS - -#endif - - diff --git a/gtk/gtktextbtreeprivate.h b/gtk/gtktextbtreeprivate.h new file mode 100644 index 0000000000..86e79a4b0e --- /dev/null +++ b/gtk/gtktextbtreeprivate.h @@ -0,0 +1,350 @@ +/* GTK - The GIMP Toolkit + * gtktextbtree.h Copyright (C) 2000 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_TEXT_BTREE_PRIVATE_H__ +#define __GTK_TEXT_BTREE_PRIVATE_H__ + +#if 0 +#define DEBUG_VALIDATION_AND_SCROLLING +#endif + +#ifdef DEBUG_VALIDATION_AND_SCROLLING +#define DV(x) (x) +#else +#define DV(x) +#endif + +#include +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +GtkTextBTree *_gtk_text_btree_new (GtkTextTagTable *table, + GtkTextBuffer *buffer); +void _gtk_text_btree_ref (GtkTextBTree *tree); +void _gtk_text_btree_unref (GtkTextBTree *tree); +GtkTextBuffer *_gtk_text_btree_get_buffer (GtkTextBTree *tree); + + +guint _gtk_text_btree_get_chars_changed_stamp (GtkTextBTree *tree); +guint _gtk_text_btree_get_segments_changed_stamp (GtkTextBTree *tree); +void _gtk_text_btree_segments_changed (GtkTextBTree *tree); + +gboolean _gtk_text_btree_is_end (GtkTextBTree *tree, + GtkTextLine *line, + GtkTextLineSegment *seg, + int byte_index, + int char_offset); + +/* Indexable segment mutation */ + +void _gtk_text_btree_delete (GtkTextIter *start, + GtkTextIter *end); +void _gtk_text_btree_insert (GtkTextIter *iter, + const char *text, + int len); +void _gtk_text_btree_insert_paintable (GtkTextIter *iter, + GdkPaintable *texture); + +void _gtk_text_btree_insert_child_anchor (GtkTextIter *iter, + GtkTextChildAnchor *anchor); + +void _gtk_text_btree_unregister_child_anchor (GtkTextChildAnchor *anchor); + +/* View stuff */ +GtkTextLine *_gtk_text_btree_find_line_by_y (GtkTextBTree *tree, + gpointer view_id, + int ypixel, + int *line_top_y); +int _gtk_text_btree_find_line_top (GtkTextBTree *tree, + GtkTextLine *line, + gpointer view_id); +void _gtk_text_btree_add_view (GtkTextBTree *tree, + GtkTextLayout *layout); +void _gtk_text_btree_remove_view (GtkTextBTree *tree, + gpointer view_id); +void _gtk_text_btree_invalidate_region (GtkTextBTree *tree, + const GtkTextIter *start, + const GtkTextIter *end, + gboolean cursors_only); +void _gtk_text_btree_get_view_size (GtkTextBTree *tree, + gpointer view_id, + int *width, + int *height); +gboolean _gtk_text_btree_is_valid (GtkTextBTree *tree, + gpointer view_id); +gboolean _gtk_text_btree_validate (GtkTextBTree *tree, + gpointer view_id, + int max_pixels, + int *y, + int *old_height, + int *new_height); +void _gtk_text_btree_validate_line (GtkTextBTree *tree, + GtkTextLine *line, + gpointer view_id); + +/* Tag */ + +void _gtk_text_btree_tag (const GtkTextIter *start, + const GtkTextIter *end, + GtkTextTag *tag, + gboolean apply); + +/* "Getters" */ + +GtkTextLine * _gtk_text_btree_get_line (GtkTextBTree *tree, + int line_number, + int *real_line_number); +GtkTextLine * _gtk_text_btree_get_line_no_last (GtkTextBTree *tree, + int line_number, + int *real_line_number); +GtkTextLine * _gtk_text_btree_get_end_iter_line (GtkTextBTree *tree); +GtkTextLine * _gtk_text_btree_get_line_at_char (GtkTextBTree *tree, + int char_index, + int *line_start_index, + int *real_char_index); +GPtrArray * _gtk_text_btree_get_tags (const GtkTextIter *iter); +char *_gtk_text_btree_get_text (const GtkTextIter *start, + const GtkTextIter *end, + gboolean include_hidden, + gboolean include_nonchars); +int _gtk_text_btree_line_count (GtkTextBTree *tree); +int _gtk_text_btree_char_count (GtkTextBTree *tree); +gboolean _gtk_text_btree_char_is_invisible (const GtkTextIter *iter); + + + +/* Get iterators (these are implemented in gtktextiter.c) */ +void _gtk_text_btree_get_iter_at_char (GtkTextBTree *tree, + GtkTextIter *iter, + int char_index); +void _gtk_text_btree_get_iter_at_line_char (GtkTextBTree *tree, + GtkTextIter *iter, + int line_number, + int char_index); +void _gtk_text_btree_get_iter_at_line_byte (GtkTextBTree *tree, + GtkTextIter *iter, + int line_number, + int byte_index); +gboolean _gtk_text_btree_get_iter_from_string (GtkTextBTree *tree, + GtkTextIter *iter, + const char *string); +gboolean _gtk_text_btree_get_iter_at_mark_name (GtkTextBTree *tree, + GtkTextIter *iter, + const char *mark_name); +void _gtk_text_btree_get_iter_at_mark (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextMark *mark); +void _gtk_text_btree_get_iter_at_paintable (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextLineSegment *seg); +void _gtk_text_btree_get_end_iter (GtkTextBTree *tree, + GtkTextIter *iter); +void _gtk_text_btree_get_iter_at_line (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextLine *line, + int byte_offset); +gboolean _gtk_text_btree_get_iter_at_first_toggle (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextTag *tag); +gboolean _gtk_text_btree_get_iter_at_last_toggle (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextTag *tag); + +void _gtk_text_btree_get_iter_at_child_anchor (GtkTextBTree *tree, + GtkTextIter *iter, + GtkTextChildAnchor *anchor); + + + +/* Manipulate marks */ +GtkTextMark *_gtk_text_btree_set_mark (GtkTextBTree *tree, + GtkTextMark *existing_mark, + const char *name, + gboolean left_gravity, + const GtkTextIter *index, + gboolean should_exist); +void _gtk_text_btree_remove_mark_by_name (GtkTextBTree *tree, + const char *name); +void _gtk_text_btree_remove_mark (GtkTextBTree *tree, + GtkTextMark *segment); +gboolean _gtk_text_btree_get_selection_bounds (GtkTextBTree *tree, + GtkTextIter *start, + GtkTextIter *end); +void _gtk_text_btree_place_cursor (GtkTextBTree *tree, + const GtkTextIter *where); +void _gtk_text_btree_select_range (GtkTextBTree *tree, + const GtkTextIter *ins, + const GtkTextIter *bound); +gboolean _gtk_text_btree_mark_is_insert (GtkTextBTree *tree, + GtkTextMark *segment); +gboolean _gtk_text_btree_mark_is_selection_bound (GtkTextBTree *tree, + GtkTextMark *segment); +GtkTextMark *_gtk_text_btree_get_insert (GtkTextBTree *tree); +GtkTextMark *_gtk_text_btree_get_selection_bound (GtkTextBTree *tree); +GtkTextMark *_gtk_text_btree_get_mark_by_name (GtkTextBTree *tree, + const char *name); +GtkTextLine * _gtk_text_btree_first_could_contain_tag (GtkTextBTree *tree, + GtkTextTag *tag); +GtkTextLine * _gtk_text_btree_last_could_contain_tag (GtkTextBTree *tree, + GtkTextTag *tag); + +/* Lines */ + +/* Chunk of data associated with a line; views can use this to store + info at the line. They should "subclass" the header struct here. */ +struct _GtkTextLineData { + gpointer view_id; + GtkTextLineData *next; + int height; + int top_ink : 16; + int bottom_ink : 16; + signed int width : 24; + guint valid : 8; /* Actually a boolean */ +}; + +/* + * The data structure below defines a single line of text (from newline + * to newline, not necessarily what appears on one line of the screen). + * + * You can consider this line a "paragraph" also + */ + +struct _GtkTextLine { + GtkTextBTreeNode *parent; /* Pointer to parent node containing + * line. */ + GtkTextLine *next; /* Next in linked list of lines with + * same parent node in B-tree. NULL + * means end of list. */ + GtkTextLineSegment *segments; /* First in ordered list of segments + * that make up the line. */ + GtkTextLineData *views; /* data stored here by views */ + guchar dir_strong; /* BiDi algo dir of line */ + guchar dir_propagated_back; /* BiDi algo dir of next line */ + guchar dir_propagated_forward; /* BiDi algo dir of prev line */ +}; + + +int _gtk_text_line_get_number (GtkTextLine *line); +gboolean _gtk_text_line_char_has_tag (GtkTextLine *line, + GtkTextBTree *tree, + int char_in_line, + GtkTextTag *tag); +gboolean _gtk_text_line_byte_has_tag (GtkTextLine *line, + GtkTextBTree *tree, + int byte_in_line, + GtkTextTag *tag); +gboolean _gtk_text_line_is_last (GtkTextLine *line, + GtkTextBTree *tree); +gboolean _gtk_text_line_contains_end_iter (GtkTextLine *line, + GtkTextBTree *tree); +GtkTextLine * _gtk_text_line_next (GtkTextLine *line); +GtkTextLine * _gtk_text_line_next_excluding_last (GtkTextLine *line); +GtkTextLine * _gtk_text_line_previous (GtkTextLine *line); +void _gtk_text_line_add_data (GtkTextLine *line, + GtkTextLineData *data); +gpointer _gtk_text_line_remove_data (GtkTextLine *line, + gpointer view_id); +gpointer _gtk_text_line_get_data (GtkTextLine *line, + gpointer view_id); +void _gtk_text_line_invalidate_wrap (GtkTextLine *line, + GtkTextLineData *ld); +int _gtk_text_line_char_count (GtkTextLine *line); +int _gtk_text_line_byte_count (GtkTextLine *line); +int _gtk_text_line_char_index (GtkTextLine *line); +GtkTextLineSegment *_gtk_text_line_byte_to_segment (GtkTextLine *line, + int byte_offset, + int *seg_offset); +GtkTextLineSegment *_gtk_text_line_char_to_segment (GtkTextLine *line, + int char_offset, + int *seg_offset); +gboolean _gtk_text_line_byte_locate (GtkTextLine *line, + int byte_offset, + GtkTextLineSegment **segment, + GtkTextLineSegment **any_segment, + int *seg_byte_offset, + int *line_byte_offset); +gboolean _gtk_text_line_char_locate (GtkTextLine *line, + int char_offset, + GtkTextLineSegment **segment, + GtkTextLineSegment **any_segment, + int *seg_char_offset, + int *line_char_offset); +void _gtk_text_line_byte_to_char_offsets (GtkTextLine *line, + int byte_offset, + int *line_char_offset, + int *seg_char_offset); +void _gtk_text_line_char_to_byte_offsets (GtkTextLine *line, + int char_offset, + int *line_byte_offset, + int *seg_byte_offset); +GtkTextLineSegment *_gtk_text_line_byte_to_any_segment (GtkTextLine *line, + int byte_offset, + int *seg_offset); +GtkTextLineSegment *_gtk_text_line_char_to_any_segment (GtkTextLine *line, + int char_offset, + int *seg_offset); +int _gtk_text_line_byte_to_char (GtkTextLine *line, + int byte_offset); +int _gtk_text_line_char_to_byte (GtkTextLine *line, + int char_offset); +GtkTextLine * _gtk_text_line_next_could_contain_tag (GtkTextLine *line, + GtkTextBTree *tree, + GtkTextTag *tag); +GtkTextLine * _gtk_text_line_previous_could_contain_tag (GtkTextLine *line, + GtkTextBTree *tree, + GtkTextTag *tag); + +GtkTextLineData *_gtk_text_line_data_new (GtkTextLayout *layout, + GtkTextLine *line); + +/* Debug */ +void _gtk_text_btree_check (GtkTextBTree *tree); +void _gtk_text_btree_spew (GtkTextBTree *tree); +extern gboolean _gtk_text_view_debug_btree; + +/* ignore, exported only for gtktextsegment.c */ +void _gtk_toggle_segment_check_func (GtkTextLineSegment *segPtr, + GtkTextLine *line); +void _gtk_change_node_toggle_count (GtkTextBTreeNode *node, + GtkTextTagInfo *info, + int delta); + +/* for gtktextmark.c */ +void _gtk_text_btree_release_mark_segment (GtkTextBTree *tree, + GtkTextLineSegment *segment); + +/* for coordination with the tag table */ +void _gtk_text_btree_notify_will_remove_tag (GtkTextBTree *tree, + GtkTextTag *tag); + +G_END_DECLS + +#endif + + diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c index 0d59288d93..c396a5e015 100644 --- a/gtk/gtktextbuffer.c +++ b/gtk/gtktextbuffer.c @@ -31,11 +31,11 @@ #include "gtktextbuffer.h" #include "gtktexthistoryprivate.h" #include "gtktextbufferprivate.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtktextiterprivate.h" #include "gtktexttagprivate.h" #include "gtktexttagtableprivate.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtkprivate.h" #define DEFAULT_MAX_UNDO 200 diff --git a/gtk/gtktextbufferprivate.h b/gtk/gtktextbufferprivate.h index ef22648ac5..941bc6f05d 100644 --- a/gtk/gtktextbufferprivate.h +++ b/gtk/gtktextbufferprivate.h @@ -19,7 +19,7 @@ #define __GTK_TEXT_BUFFER_PRIVATE_H__ #include -#include "gtktexttypes.h" +#include "gtktexttypesprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtktextchild.c b/gtk/gtktextchild.c index c64654835c..b3ca5908f6 100644 --- a/gtk/gtktextchild.c +++ b/gtk/gtktextchild.c @@ -49,7 +49,7 @@ #include "config.h" #include "gtktextchild.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtktextlayoutprivate.h" #include "gtkprivate.h" diff --git a/gtk/gtktextchildprivate.h b/gtk/gtktextchildprivate.h index b3d1127f7a..e8e94b51d7 100644 --- a/gtk/gtktextchildprivate.h +++ b/gtk/gtktextchildprivate.h @@ -50,7 +50,7 @@ #ifndef __GTK_TEXT_CHILD_PRIVATE_H__ #define __GTK_TEXT_CHILD_PRIVATE_H__ -#include +#include G_BEGIN_DECLS diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c index fcc4597656..9ffbf581a3 100644 --- a/gtk/gtktextiter.c +++ b/gtk/gtktextiter.c @@ -24,7 +24,7 @@ #include "config.h" #include "gtktextiter.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtktextbufferprivate.h" #include "gtktextiterprivate.h" #include "gtkdebug.h" diff --git a/gtk/gtktextiterprivate.h b/gtk/gtktextiterprivate.h index e9503995f7..d044cdc8cc 100644 --- a/gtk/gtktextiterprivate.h +++ b/gtk/gtktextiterprivate.h @@ -30,8 +30,8 @@ G_BEGIN_DECLS #include -#include -#include +#include +#include GtkTextLineSegment *_gtk_text_iter_get_indexable_segment (const GtkTextIter *iter); GtkTextLineSegment *_gtk_text_iter_get_any_segment (const GtkTextIter *iter); diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c index f394984977..ce97ff6252 100644 --- a/gtk/gtktextlayout.c +++ b/gtk/gtktextlayout.c @@ -82,12 +82,12 @@ #include "gtkcsscolorvalueprivate.h" #include "gtkmarshalers.h" #include "gtkstylecontextprivate.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtktextbufferprivate.h" #include "gtktextiterprivate.h" #include "gtktextlinedisplaycacheprivate.h" -#include "gtktextutil.h" -#include "gskpango.h" +#include "gtktextutilprivate.h" +#include "gskpangoprivate.h" #include "gtksnapshotprivate.h" #include "gtkwidgetprivate.h" #include "gtktextviewprivate.h" diff --git a/gtk/gtktextlayoutprivate.h b/gtk/gtktextlayoutprivate.h index 480d1ada62..1aff8acf72 100644 --- a/gtk/gtktextlayoutprivate.h +++ b/gtk/gtktextlayoutprivate.h @@ -79,7 +79,7 @@ #define __GTK_TEXT_LAYOUT_PRIVATE_H__ #include -#include +#include G_BEGIN_DECLS diff --git a/gtk/gtktextlinedisplaycache.c b/gtk/gtktextlinedisplaycache.c index 414d533cc2..1269f5654d 100644 --- a/gtk/gtktextlinedisplaycache.c +++ b/gtk/gtktextlinedisplaycache.c @@ -19,7 +19,7 @@ #include "config.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtktextbufferprivate.h" #include "gtktextiterprivate.h" #include "gtktextlinedisplaycacheprivate.h" diff --git a/gtk/gtktextmark.c b/gtk/gtktextmark.c index ac4a2f1f22..f1c5edb4be 100644 --- a/gtk/gtktextmark.c +++ b/gtk/gtktextmark.c @@ -48,7 +48,7 @@ */ #include "config.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include "gtkprivate.h" diff --git a/gtk/gtktextmarkprivate.h b/gtk/gtktextmarkprivate.h index ca09d46149..7e584ad0f2 100644 --- a/gtk/gtktextmarkprivate.h +++ b/gtk/gtktextmarkprivate.h @@ -25,7 +25,7 @@ #ifndef __GTK_TEXT_MARK_PRIVATE_H__ #define __GTK_TEXT_MARK_PRIVATE_H__ -#include +#include #include "gtktextlayoutprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtktextsegment.c b/gtk/gtktextsegment.c index 0680b73cfa..e243b5a267 100644 --- a/gtk/gtktextsegment.c +++ b/gtk/gtktextsegment.c @@ -51,7 +51,7 @@ */ #include "config.h" -#include "gtktextbtree.h" +#include "gtktextbtreeprivate.h" #include #include #include diff --git a/gtk/gtktextsegment.h b/gtk/gtktextsegment.h deleted file mode 100644 index ce093d4301..0000000000 --- a/gtk/gtktextsegment.h +++ /dev/null @@ -1,172 +0,0 @@ -/* GTK - The GIMP Toolkit - * gtktextsegment.h Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_TEXT_SEGMENT_H__ -#define __GTK_TEXT_SEGMENT_H__ - -#include -#include -#include -#include -#include - -G_BEGIN_DECLS - -/* - * Segments: each line is divided into one or more segments, where each - * segment is one of several things, such as a group of characters, a - * tag toggle, a mark, or an embedded widget. Each segment starts with - * a standard header followed by a body that varies from type to type. - */ - -/* This header has the segment type, and two specific segments - (character and toggle segments) */ - -/* Information a BTree stores about a tag. */ -typedef struct _GtkTextTagInfo GtkTextTagInfo; -struct _GtkTextTagInfo { - GtkTextTag *tag; - GtkTextBTreeNode *tag_root; /* highest-level node containing the tag */ - int toggle_count; /* total toggles of this tag below tag_root */ -}; - -/* Body of a segment that toggles a tag on or off */ -struct _GtkTextToggleBody { - GtkTextTagInfo *info; /* Tag that starts or ends here. */ - gboolean inNodeCounts; /* TRUE means this toggle has been - * accounted for in node toggle - * counts; FALSE means it hasn't, yet. */ -}; - - -/* Class struct for segments */ - -/* Split seg at index, returning list of two new segments, and freeing seg */ -typedef GtkTextLineSegment* (*GtkTextSegSplitFunc) (GtkTextLineSegment *seg, - int index); - -/* Delete seg which is contained in line; if tree_gone, the tree is being - * freed in its entirety, which may matter for some reason (?) - * Return TRUE if the segment is not deleteable, e.g. a mark. - */ -typedef gboolean (*GtkTextSegDeleteFunc) (GtkTextLineSegment *seg, - GtkTextLine *line, - gboolean tree_gone); - -/* Called after segment structure of line changes, so segments can - * cleanup (e.g. merge with adjacent segments). Returns a segment list - * to replace the original segment list with. The line argument is - * the current line. - */ -typedef GtkTextLineSegment* (*GtkTextSegCleanupFunc) (GtkTextLineSegment *seg, - GtkTextLine *line); - -/* Called when a segment moves from one line to another. CleanupFunc is also - * called in that case, so many segments just use CleanupFunc, I'm not sure - * what’s up with that (this function may not be needed...) - */ -typedef void (*GtkTextSegLineChangeFunc) (GtkTextLineSegment *seg, - GtkTextLine *line); - -/* Called to do debug checks on the segment. */ -typedef void (*GtkTextSegCheckFunc) (GtkTextLineSegment *seg, - GtkTextLine *line); - -struct _GtkTextLineSegmentClass { - const char *name; /* Name of this kind of segment. */ - gboolean leftGravity; /* If a segment has zero size (e.g. a - * mark or tag toggle), does it - * attach to character to its left - * or right? 1 means left, 0 means - * right. */ - GtkTextSegSplitFunc splitFunc; /* Procedure to split large segment - * into two smaller ones. */ - GtkTextSegDeleteFunc deleteFunc; /* Procedure to call to delete - * segment. */ - GtkTextSegCleanupFunc cleanupFunc; /* After any change to a line, this - * procedure is invoked for all - * segments left in the line to - * perform any cleanup they wish - * (e.g. joining neighboring - * segments). */ - GtkTextSegLineChangeFunc lineChangeFunc; - /* Invoked when a segment is about - * to be moved from its current line - * to an earlier line because of - * a deletion. The line is that - * for the segment's old line. - * CleanupFunc will be invoked after - * the deletion is finished. */ - - GtkTextSegCheckFunc checkFunc; /* Called during consistency checks - * to check internal consistency of - * segment. */ -}; - -/* - * The data structure below defines line segments. - */ - -struct _GtkTextLineSegment { - const GtkTextLineSegmentClass *type; /* Pointer to record describing - * segment's type. */ - GtkTextLineSegment *next; /* Next in list of segments for this - * line, or NULL for end of list. */ - - int char_count; /* # of chars of index space occupied */ - - int byte_count; /* Size of this segment (# of bytes - * of index space it occupies). */ - union { - char chars[4]; /* Characters that make up character - * info. Actual length varies to - * hold as many characters as needed.*/ - GtkTextToggleBody toggle; /* Information about tag toggle. */ - GtkTextMarkBody mark; /* Information about mark. */ - GtkTextPaintable paintable; /* Child texture */ - GtkTextChildBody child; /* Child widget */ - } body; -}; - - -GtkTextLineSegment *gtk_text_line_segment_split (const GtkTextIter *iter); - -GtkTextLineSegment *_gtk_char_segment_new (const char *text, - guint len); -GtkTextLineSegment *_gtk_char_segment_new_from_two_strings (const char *text1, - guint len1, - guint chars1, - const char *text2, - guint len2, - guint chars2); -GtkTextLineSegment *_gtk_toggle_segment_new (GtkTextTagInfo *info, - gboolean on); - -void _gtk_toggle_segment_free (GtkTextLineSegment *seg); - -G_END_DECLS - -#endif - - diff --git a/gtk/gtktextsegmentprivate.h b/gtk/gtktextsegmentprivate.h new file mode 100644 index 0000000000..7f59f28e99 --- /dev/null +++ b/gtk/gtktextsegmentprivate.h @@ -0,0 +1,172 @@ +/* GTK - The GIMP Toolkit + * gtktextsegment.h Copyright (C) 2000 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_TEXT_SEGMENT_PRIVATE_H__ +#define __GTK_TEXT_SEGMENT_PRIVATE_H__ + +#include +#include +#include +#include +#include + +G_BEGIN_DECLS + +/* + * Segments: each line is divided into one or more segments, where each + * segment is one of several things, such as a group of characters, a + * tag toggle, a mark, or an embedded widget. Each segment starts with + * a standard header followed by a body that varies from type to type. + */ + +/* This header has the segment type, and two specific segments + (character and toggle segments) */ + +/* Information a BTree stores about a tag. */ +typedef struct _GtkTextTagInfo GtkTextTagInfo; +struct _GtkTextTagInfo { + GtkTextTag *tag; + GtkTextBTreeNode *tag_root; /* highest-level node containing the tag */ + int toggle_count; /* total toggles of this tag below tag_root */ +}; + +/* Body of a segment that toggles a tag on or off */ +struct _GtkTextToggleBody { + GtkTextTagInfo *info; /* Tag that starts or ends here. */ + gboolean inNodeCounts; /* TRUE means this toggle has been + * accounted for in node toggle + * counts; FALSE means it hasn't, yet. */ +}; + + +/* Class struct for segments */ + +/* Split seg at index, returning list of two new segments, and freeing seg */ +typedef GtkTextLineSegment* (*GtkTextSegSplitFunc) (GtkTextLineSegment *seg, + int index); + +/* Delete seg which is contained in line; if tree_gone, the tree is being + * freed in its entirety, which may matter for some reason (?) + * Return TRUE if the segment is not deleteable, e.g. a mark. + */ +typedef gboolean (*GtkTextSegDeleteFunc) (GtkTextLineSegment *seg, + GtkTextLine *line, + gboolean tree_gone); + +/* Called after segment structure of line changes, so segments can + * cleanup (e.g. merge with adjacent segments). Returns a segment list + * to replace the original segment list with. The line argument is + * the current line. + */ +typedef GtkTextLineSegment* (*GtkTextSegCleanupFunc) (GtkTextLineSegment *seg, + GtkTextLine *line); + +/* Called when a segment moves from one line to another. CleanupFunc is also + * called in that case, so many segments just use CleanupFunc, I'm not sure + * what’s up with that (this function may not be needed...) + */ +typedef void (*GtkTextSegLineChangeFunc) (GtkTextLineSegment *seg, + GtkTextLine *line); + +/* Called to do debug checks on the segment. */ +typedef void (*GtkTextSegCheckFunc) (GtkTextLineSegment *seg, + GtkTextLine *line); + +struct _GtkTextLineSegmentClass { + const char *name; /* Name of this kind of segment. */ + gboolean leftGravity; /* If a segment has zero size (e.g. a + * mark or tag toggle), does it + * attach to character to its left + * or right? 1 means left, 0 means + * right. */ + GtkTextSegSplitFunc splitFunc; /* Procedure to split large segment + * into two smaller ones. */ + GtkTextSegDeleteFunc deleteFunc; /* Procedure to call to delete + * segment. */ + GtkTextSegCleanupFunc cleanupFunc; /* After any change to a line, this + * procedure is invoked for all + * segments left in the line to + * perform any cleanup they wish + * (e.g. joining neighboring + * segments). */ + GtkTextSegLineChangeFunc lineChangeFunc; + /* Invoked when a segment is about + * to be moved from its current line + * to an earlier line because of + * a deletion. The line is that + * for the segment's old line. + * CleanupFunc will be invoked after + * the deletion is finished. */ + + GtkTextSegCheckFunc checkFunc; /* Called during consistency checks + * to check internal consistency of + * segment. */ +}; + +/* + * The data structure below defines line segments. + */ + +struct _GtkTextLineSegment { + const GtkTextLineSegmentClass *type; /* Pointer to record describing + * segment's type. */ + GtkTextLineSegment *next; /* Next in list of segments for this + * line, or NULL for end of list. */ + + int char_count; /* # of chars of index space occupied */ + + int byte_count; /* Size of this segment (# of bytes + * of index space it occupies). */ + union { + char chars[4]; /* Characters that make up character + * info. Actual length varies to + * hold as many characters as needed.*/ + GtkTextToggleBody toggle; /* Information about tag toggle. */ + GtkTextMarkBody mark; /* Information about mark. */ + GtkTextPaintable paintable; /* Child texture */ + GtkTextChildBody child; /* Child widget */ + } body; +}; + + +GtkTextLineSegment *gtk_text_line_segment_split (const GtkTextIter *iter); + +GtkTextLineSegment *_gtk_char_segment_new (const char *text, + guint len); +GtkTextLineSegment *_gtk_char_segment_new_from_two_strings (const char *text1, + guint len1, + guint chars1, + const char *text2, + guint len2, + guint chars2); +GtkTextLineSegment *_gtk_toggle_segment_new (GtkTextTagInfo *info, + gboolean on); + +void _gtk_toggle_segment_free (GtkTextLineSegment *seg); + +G_END_DECLS + +#endif + + diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c index 397dac13af..7d28a8996f 100644 --- a/gtk/gtktexttag.c +++ b/gtk/gtktexttag.c @@ -76,7 +76,7 @@ #include #include "gtktexttag.h" -#include "gtktexttypes.h" +#include "gtktexttypesprivate.h" #include "gtktexttagtable.h" #include "gtktexttagtableprivate.h" #include "gtkmarshalers.h" diff --git a/gtk/gtktexttagprivate.h b/gtk/gtktexttagprivate.h index 57ce42c2c6..4092fc1532 100644 --- a/gtk/gtktexttagprivate.h +++ b/gtk/gtktexttagprivate.h @@ -26,7 +26,7 @@ #define __GTK_TEXT_TAG_PRIVATE_H__ #include -#include +#include typedef struct _GtkTextBTreeNode GtkTextBTreeNode; diff --git a/gtk/gtktexttypes.c b/gtk/gtktexttypes.c index f9646ac9b8..6b5ee3c5a1 100644 --- a/gtk/gtktexttypes.c +++ b/gtk/gtktexttypes.c @@ -23,7 +23,7 @@ */ #include "config.h" -#include "gtktexttypes.h" +#include "gtktexttypesprivate.h" /* These are used to represent embedded non-character objects * if you return a string representation of a text buffer diff --git a/gtk/gtktexttypes.h b/gtk/gtktexttypes.h deleted file mode 100644 index 1d799ee952..0000000000 --- a/gtk/gtktexttypes.h +++ /dev/null @@ -1,79 +0,0 @@ -/* GTK - The GIMP Toolkit - * gtktexttypes.h Copyright (C) 2000 Red Hat, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_TEXT_TYPES_H__ -#define __GTK_TEXT_TYPES_H__ - -#include -#include - -G_BEGIN_DECLS - -/* - * This is the PUBLIC representation of a text buffer. - * GtkTextBTree is the PRIVATE internal representation of it. - */ - -typedef struct _GtkTextBTree GtkTextBTree; - -typedef struct _GtkTextCounter GtkTextCounter; -typedef struct _GtkTextLineSegment GtkTextLineSegment; -typedef struct _GtkTextLineSegmentClass GtkTextLineSegmentClass; -typedef struct _GtkTextToggleBody GtkTextToggleBody; -typedef struct _GtkTextMarkBody GtkTextMarkBody; - -/* - * Declarations for variables shared among the text-related files: - */ - -/* In gtktextbtree.c */ -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_char_type; -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_toggle_on_type; -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_toggle_off_type; - -/* In gtktextmark.c */ -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_left_mark_type; -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_right_mark_type; - -/* In gtktextchild.c */ -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_paintable_type; -extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_child_type; - -/* - * UTF 8 Stubs - */ - -#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC -#define GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN 3 -GDK_AVAILABLE_IN_ALL -const char *gtk_text_unknown_char_utf8_gtk_tests_only (void); -extern const char _gtk_text_unknown_char_utf8[GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN+1]; - -GDK_AVAILABLE_IN_ALL -gboolean gtk_text_byte_begins_utf8_char (const char *byte); - -G_END_DECLS - -#endif - diff --git a/gtk/gtktexttypesprivate.h b/gtk/gtktexttypesprivate.h new file mode 100644 index 0000000000..c996e184c0 --- /dev/null +++ b/gtk/gtktexttypesprivate.h @@ -0,0 +1,79 @@ +/* GTK - The GIMP Toolkit + * gtktexttypes.h Copyright (C) 2000 Red Hat, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_TEXT_TYPES_PRIVATE_H__ +#define __GTK_TEXT_TYPES_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + +/* + * This is the PUBLIC representation of a text buffer. + * GtkTextBTree is the PRIVATE internal representation of it. + */ + +typedef struct _GtkTextBTree GtkTextBTree; + +typedef struct _GtkTextCounter GtkTextCounter; +typedef struct _GtkTextLineSegment GtkTextLineSegment; +typedef struct _GtkTextLineSegmentClass GtkTextLineSegmentClass; +typedef struct _GtkTextToggleBody GtkTextToggleBody; +typedef struct _GtkTextMarkBody GtkTextMarkBody; + +/* + * Declarations for variables shared among the text-related files: + */ + +/* In gtktextbtree.c */ +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_char_type; +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_toggle_on_type; +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_toggle_off_type; + +/* In gtktextmark.c */ +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_left_mark_type; +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_right_mark_type; + +/* In gtktextchild.c */ +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_paintable_type; +extern G_GNUC_INTERNAL const GtkTextLineSegmentClass gtk_text_child_type; + +/* + * UTF 8 Stubs + */ + +#define GTK_TEXT_UNKNOWN_CHAR 0xFFFC +#define GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN 3 +GDK_AVAILABLE_IN_ALL +const char *gtk_text_unknown_char_utf8_gtk_tests_only (void); +extern const char _gtk_text_unknown_char_utf8[GTK_TEXT_UNKNOWN_CHAR_UTF8_LEN+1]; + +GDK_AVAILABLE_IN_ALL +gboolean gtk_text_byte_begins_utf8_char (const char *byte); + +G_END_DECLS + +#endif + diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c index 425ae65a2b..0ec6216dbe 100644 --- a/gtk/gtktextutil.c +++ b/gtk/gtktextutil.c @@ -25,7 +25,7 @@ #include "config.h" #include "gtktextview.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" #include "gtkcsscolorvalueprivate.h" #include "gtkstylecontextprivate.h" diff --git a/gtk/gtktextutil.h b/gtk/gtktextutil.h deleted file mode 100644 index 512532c4d0..0000000000 --- a/gtk/gtktextutil.h +++ /dev/null @@ -1,51 +0,0 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -/* - * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS - * file for a list of people on the GTK+ Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. - */ - -#ifndef __GTK_TEXT_UTIL_H__ -#define __GTK_TEXT_UTIL_H__ - -G_BEGIN_DECLS - -#include "gtktextbuffer.h" - -/* This is a private uninstalled header shared between - * GtkTextView and GtkEntry - */ - -GdkPaintable * gtk_text_util_create_drag_icon (GtkWidget *widget, - char *text, - gssize len); -GdkPaintable * gtk_text_util_create_rich_drag_icon (GtkWidget *widget, - GtkTextBuffer *buffer, - GtkTextIter *start, - GtkTextIter *end); - -gboolean _gtk_text_util_get_block_cursor_location (PangoLayout *layout, - int index_, - PangoRectangle *rectangle, - gboolean *at_line_end); - -G_END_DECLS - -#endif /* __GTK_TEXT_UTIL_H__ */ diff --git a/gtk/gtktextutilprivate.h b/gtk/gtktextutilprivate.h new file mode 100644 index 0000000000..11e47a74a5 --- /dev/null +++ b/gtk/gtktextutilprivate.h @@ -0,0 +1,51 @@ +/* GTK - The GIMP Toolkit + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +/* + * Modified by the GTK+ Team and others 1997-2001. See the AUTHORS + * file for a list of people on the GTK+ Team. See the ChangeLog + * files for a list of changes. These files are distributed with + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. + */ + +#ifndef __GTK_TEXT_UTIL_PRIVATE_H__ +#define __GTK_TEXT_UTIL_PRIVATE_H__ + +G_BEGIN_DECLS + +#include "gtktextbuffer.h" + +/* This is a private uninstalled header shared between + * GtkTextView and GtkEntry + */ + +GdkPaintable * gtk_text_util_create_drag_icon (GtkWidget *widget, + char *text, + gssize len); +GdkPaintable * gtk_text_util_create_rich_drag_icon (GtkWidget *widget, + GtkTextBuffer *buffer, + GtkTextIter *start, + GtkTextIter *end); + +gboolean _gtk_text_util_get_block_cursor_location (PangoLayout *layout, + int index_, + PangoRectangle *rectangle, + gboolean *at_line_end); + +G_END_DECLS + +#endif /* __GTK_TEXT_UTIL_PRIVATE_H__ */ diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c index 7277035dbe..754083b9a1 100644 --- a/gtk/gtktextview.c +++ b/gtk/gtktextview.c @@ -42,7 +42,7 @@ #include "gtktextiterprivate.h" #include "gtkimmulticontext.h" #include "gtkprivate.h" -#include "gtktextutil.h" +#include "gtktextutilprivate.h" #include "gtkwidgetprivate.h" #include "gtkwindow.h" #include "gtkscrollable.h" @@ -53,7 +53,7 @@ #include "gtkpopover.h" #include "gtkmagnifierprivate.h" #include "gtkemojichooser.h" -#include "gtkpango.h" +#include "gtkpangoprivate.h" #include "gtknative.h" #include "gtkwidgetprivate.h" #include "gtkjoinedmenuprivate.h" diff --git a/gtk/gtktextviewprivate.h b/gtk/gtktextviewprivate.h index 13d9af255e..1cc9b79147 100644 --- a/gtk/gtktextviewprivate.h +++ b/gtk/gtktextviewprivate.h @@ -20,7 +20,7 @@ #define __GTK_TEXT_VIEW_PRIVATE_H__ #include "gtktextview.h" -#include "gtktextattributes.h" +#include "gtktextattributesprivate.h" #include "gtkcssnodeprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtktrashmonitor.c b/gtk/gtktrashmonitor.c index 3990d65852..94dfca819b 100644 --- a/gtk/gtktrashmonitor.c +++ b/gtk/gtktrashmonitor.c @@ -22,7 +22,7 @@ #include "gtkprivate.h" #include "gtkmarshalers.h" -#include "gtktrashmonitor.h" +#include "gtktrashmonitorprivate.h" #define UPDATE_RATE_SECONDS 1 diff --git a/gtk/gtktrashmonitor.h b/gtk/gtktrashmonitor.h deleted file mode 100644 index 619d5c3304..0000000000 --- a/gtk/gtktrashmonitor.h +++ /dev/null @@ -1,47 +0,0 @@ -/* GTK - The GIMP Toolkit - * gtktrashmonitor.h: Monitor the trash:/// folder to see if there is trash or not - * Copyright (C) 2011 Suse - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as - * published by the Free Software Foundation; either version 2.1 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, see . - * - * Authors: Federico Mena Quintero - */ - -#ifndef __GTK_TRASH_MONITOR_H__ -#define __GTK_TRASH_MONITOR_H__ - -#include - -G_BEGIN_DECLS - -#define GTK_TYPE_TRASH_MONITOR (_gtk_trash_monitor_get_type ()) -#define GTK_TRASH_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitor)) -#define GTK_TRASH_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitorClass)) -#define GTK_IS_TRASH_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TRASH_MONITOR)) -#define GTK_IS_TRASH_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TRASH_MONITOR)) -#define GTK_TRASH_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitorClass)) - -typedef struct _GtkTrashMonitor GtkTrashMonitor; -typedef struct _GtkTrashMonitorClass GtkTrashMonitorClass; - -GType _gtk_trash_monitor_get_type (void); -GtkTrashMonitor *_gtk_trash_monitor_get (void); - -GIcon *_gtk_trash_monitor_get_icon (GtkTrashMonitor *monitor); - -gboolean _gtk_trash_monitor_get_has_trash (GtkTrashMonitor *monitor); - -G_END_DECLS - -#endif /* __GTK_TRASH_MONITOR_H__ */ diff --git a/gtk/gtktrashmonitorprivate.h b/gtk/gtktrashmonitorprivate.h new file mode 100644 index 0000000000..32bdc05536 --- /dev/null +++ b/gtk/gtktrashmonitorprivate.h @@ -0,0 +1,47 @@ +/* GTK - The GIMP Toolkit + * gtktrashmonitor.h: Monitor the trash:/// folder to see if there is trash or not + * Copyright (C) 2011 Suse + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, see . + * + * Authors: Federico Mena Quintero + */ + +#ifndef __GTK_TRASH_MONITOR_PRIVATE_H__ +#define __GTK_TRASH_MONITOR_PRIVATE_H__ + +#include + +G_BEGIN_DECLS + +#define GTK_TYPE_TRASH_MONITOR (_gtk_trash_monitor_get_type ()) +#define GTK_TRASH_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitor)) +#define GTK_TRASH_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitorClass)) +#define GTK_IS_TRASH_MONITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TRASH_MONITOR)) +#define GTK_IS_TRASH_MONITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TRASH_MONITOR)) +#define GTK_TRASH_MONITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TRASH_MONITOR, GtkTrashMonitorClass)) + +typedef struct _GtkTrashMonitor GtkTrashMonitor; +typedef struct _GtkTrashMonitorClass GtkTrashMonitorClass; + +GType _gtk_trash_monitor_get_type (void); +GtkTrashMonitor *_gtk_trash_monitor_get (void); + +GIcon *_gtk_trash_monitor_get_icon (GtkTrashMonitor *monitor); + +gboolean _gtk_trash_monitor_get_has_trash (GtkTrashMonitor *monitor); + +G_END_DECLS + +#endif /* __GTK_TRASH_MONITOR_PRIVATE_H__ */ diff --git a/gtk/gtktreedatalist.c b/gtk/gtktreedatalist.c index b5a479ad29..4e35edbe56 100644 --- a/gtk/gtktreedatalist.c +++ b/gtk/gtktreedatalist.c @@ -19,7 +19,7 @@ */ #include "config.h" -#include "gtktreedatalist.h" +#include "gtktreedatalistprivate.h" #include /* node allocation diff --git a/gtk/gtktreedatalist.h b/gtk/gtktreedatalist.h deleted file mode 100644 index 676311786f..0000000000 --- a/gtk/gtktreedatalist.h +++ /dev/null @@ -1,81 +0,0 @@ -/* gtktreedatalist.h - * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library. If not, see . - */ - -#ifndef __GTK_TREE_DATA_LIST_H__ -#define __GTK_TREE_DATA_LIST_H__ - -#include -#include - -typedef struct _GtkTreeDataList GtkTreeDataList; -struct _GtkTreeDataList -{ - GtkTreeDataList *next; - - union { - int v_int; - gint8 v_char; - guint8 v_uchar; - guint v_uint; - glong v_long; - gulong v_ulong; - gint64 v_int64; - guint64 v_uint64; - float v_float; - double v_double; - gpointer v_pointer; - } data; -}; - -typedef struct _GtkTreeDataSortHeader -{ - int sort_column_id; - GtkTreeIterCompareFunc func; - gpointer data; - GDestroyNotify destroy; -} GtkTreeDataSortHeader; - -GtkTreeDataList *_gtk_tree_data_list_alloc (void); -void _gtk_tree_data_list_free (GtkTreeDataList *list, - GType *column_headers); -gboolean _gtk_tree_data_list_check_type (GType type); -void _gtk_tree_data_list_node_to_value (GtkTreeDataList *list, - GType type, - GValue *value); -void _gtk_tree_data_list_value_to_node (GtkTreeDataList *list, - GValue *value); - -GtkTreeDataList *_gtk_tree_data_list_node_copy (GtkTreeDataList *list, - GType type); - -/* Header code */ -int _gtk_tree_data_list_compare_func (GtkTreeModel *model, - GtkTreeIter *a, - GtkTreeIter *b, - gpointer user_data); -GList * _gtk_tree_data_list_header_new (int n_columns, - GType *types); -void _gtk_tree_data_list_header_free (GList *header_list); -GtkTreeDataSortHeader *_gtk_tree_data_list_get_header (GList *header_list, - int sort_column_id); -GList *_gtk_tree_data_list_set_header (GList *header_list, - int sort_column_id, - GtkTreeIterCompareFunc func, - gpointer data, - GDestroyNotify destroy); - -#endif /* __GTK_TREE_DATA_LIST_H__ */ diff --git a/gtk/gtktreedatalistprivate.h b/gtk/gtktreedatalistprivate.h new file mode 100644 index 0000000000..77aa710961 --- /dev/null +++ b/gtk/gtktreedatalistprivate.h @@ -0,0 +1,81 @@ +/* gtktreedatalist.h + * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library. If not, see . + */ + +#ifndef __GTK_TREE_DATA_LIST_PRIVATE_H__ +#define __GTK_TREE_DATA_LIST_PRIVATE_H__ + +#include +#include + +typedef struct _GtkTreeDataList GtkTreeDataList; +struct _GtkTreeDataList +{ + GtkTreeDataList *next; + + union { + int v_int; + gint8 v_char; + guint8 v_uchar; + guint v_uint; + glong v_long; + gulong v_ulong; + gint64 v_int64; + guint64 v_uint64; + float v_float; + double v_double; + gpointer v_pointer; + } data; +}; + +typedef struct _GtkTreeDataSortHeader +{ + int sort_column_id; + GtkTreeIterCompareFunc func; + gpointer data; + GDestroyNotify destroy; +} GtkTreeDataSortHeader; + +GtkTreeDataList *_gtk_tree_data_list_alloc (void); +void _gtk_tree_data_list_free (GtkTreeDataList *list, + GType *column_headers); +gboolean _gtk_tree_data_list_check_type (GType type); +void _gtk_tree_data_list_node_to_value (GtkTreeDataList *list, + GType type, + GValue *value); +void _gtk_tree_data_list_value_to_node (GtkTreeDataList *list, + GValue *value); + +GtkTreeDataList *_gtk_tree_data_list_node_copy (GtkTreeDataList *list, + GType type); + +/* Header code */ +int _gtk_tree_data_list_compare_func (GtkTreeModel *model, + GtkTreeIter *a, + GtkTreeIter *b, + gpointer user_data); +GList * _gtk_tree_data_list_header_new (int n_columns, + GType *types); +void _gtk_tree_data_list_header_free (GList *header_list); +GtkTreeDataSortHeader *_gtk_tree_data_list_get_header (GList *header_list, + int sort_column_id); +GList *_gtk_tree_data_list_set_header (GList *header_list, + int sort_column_id, + GtkTreeIterCompareFunc func, + gpointer data, + GDestroyNotify destroy); + +#endif /* __GTK_TREE_DATA_LIST_PRIVATE_H__ */ diff --git a/gtk/gtktreemodelsort.c b/gtk/gtktreemodelsort.c index ee4bbcfe14..0d800da62d 100644 --- a/gtk/gtktreemodelsort.c +++ b/gtk/gtktreemodelsort.c @@ -22,7 +22,7 @@ #include "gtktreemodelsort.h" #include "gtktreesortable.h" #include "gtktreestore.h" -#include "gtktreedatalist.h" +#include "gtktreedatalistprivate.h" #include "gtkprivate.h" #include "gtktreednd.h" diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 81ce21a674..308f1c2853 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -20,7 +20,7 @@ #include #include "gtktreemodel.h" #include "gtktreestore.h" -#include "gtktreedatalist.h" +#include "gtktreedatalistprivate.h" #include "gtktreednd.h" #include "gtkbuildable.h" #include "gtkbuilderprivate.h" diff --git a/testsuite/gtk/textbuffer.c b/testsuite/gtk/textbuffer.c index f500cd65f3..13409314d7 100644 --- a/testsuite/gtk/textbuffer.c +++ b/testsuite/gtk/textbuffer.c @@ -21,7 +21,7 @@ #include #include -#include "gtk/gtktexttypes.h" /* Private header, for UNKNOWN_CHAR */ +#include "gtk/gtktexttypesprivate.h" /* Private header, for UNKNOWN_CHAR */ #include "gtk/gtktextbufferprivate.h" /* Private header */ static void